package interviewpreparationkit.stringmanipulation


import redirectSystemIn
import redirectSystemOut
import org.junit.jupiter.api.Test
import java.util.*

class CommonChildTests {
    @Test
    fun commonChildTest() {
        redirectSystemIn(this.javaClass) {
            val scan = Scanner(System.`in`)
            redirectSystemOut { expectedList ->
                while (scan.hasNextLine()) {

                    val s1 = scan.nextLine()
                    val s2 = scan.nextLine()
                    val result = commonChild(s1, s2)
                    println(result)
                    expectedList.add(scan.nextLine().trim())
                }
            }
        }
    }
}